﻿@page "/"
@inject IPoetryStorage _poetryStorage
@inject INavigationService _navigationService
@inject IFavoriteStorage _favoriteStorage

@code {

    protected override void OnAfterRender(bool firstRender) {
        if (!firstRender) {
            return;
        }

        if (!_poetryStorage.IsInitialized || !_favoriteStorage.IsInitialized) {
            _navigationService.NavigateTo(NavigationServiceConstants.InitializationPage);
        } else {
            _navigationService.NavigateTo(NavigationServiceConstants.TodayPage);
        }
    }

}